home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Hacking & Misc / RanPassword.sit / RanPassword / RanPassword-HC / card_2961.txt < prev    next >
Text File  |  1995-08-19  |  5KB  |  152 lines

  1. -- card: 2961 from stack: in
  2. -- bmap block id: 3690
  3. -- flags: 4000
  4. -- background id: 2576
  5. -- name: theCard
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 04
  10. -- high flags: 0007
  11. -- rect: left=151 top=0 right=264 bottom=256
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 3
  16. -- text size: 9
  17. -- style flags: 0
  18. -- line height: 12
  19. -- part name: thePassList
  20.  
  21.  
  22. -- part 2 (button)
  23. -- low flags: 00
  24. -- high flags: A002
  25. -- rect: left=0 top=0 right=51 bottom=124
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 128 / 128
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: Generate…
  34. ----- HyperTalk script -----
  35. on mouseUp
  36.   global ranNum,thePass,howManyTimes,howManyLetters,theCounter,theLetters
  37.   put "" into card field "thePassList"
  38.   ask "How many passwords should be generated?" with 50
  39.   if the result is "Cancel" or it = 0 then exit mouseUp
  40.   put it into howManyTimes
  41.   ask "How many letters per password?" with 8
  42.   if the result is "Cancel" or it = 0 then exit mouseUp
  43.   put it into howManyLetters
  44.   if (howManyTimes*howManyLetters)>29996 then
  45.     answer "The amount of passwords you have specified exceeds the allowable" & " limit. Not all of them will be generated. Do you still wish to continue?" with "Yes" or "No"
  46.     if it is "No" then exit mouseUp
  47.   end if
  48.   put 0 into theCounter
  49.   put 0 into theLetters
  50.   repeat howManyTimes
  51.     put "" into thePass
  52.     put 0 into theLetters
  53.     repeat while theLetters<howManyLetters
  54.       put random(74)+48 into ranNum
  55.       if ranNum<58 or ranNum>64 and ranNum<91 or ranNum>96 then
  56.         put numToChar(ranNum) after thePass
  57.         add 1 to theLetters
  58.         set cursor to busy
  59.       end if
  60.     end repeat
  61.     put thePass & return after card field "thePassList"
  62.     if theLetters=howManyLetters then add 1 to theCounter
  63.     put "Processing: " & theCounter &"/" & howManyTimes into card field "Status"
  64.     if length (card field "thePassList")>(29996-howManyLetters) then
  65.       answer "The field is full. Only " & theCounter & " passwords were generated." with "Sorry"
  66.       exit mouseup
  67.     end if
  68.   end repeat
  69.   put "Processing: Done" into card field "Status"
  70. end mouseUp
  71.  
  72.  
  73. -- part 3 (button)
  74. -- low flags: 00
  75. -- high flags: A002
  76. -- rect: left=0 top=50 right=99 bottom=124
  77. -- title width / last selected line: 0
  78. -- icon id / first selected line: 129 / 129
  79. -- text alignment: 1
  80. -- font id: 0
  81. -- text size: 12
  82. -- style flags: 0
  83. -- line height: 16
  84. -- part name: Export…
  85. ----- HyperTalk script -----
  86. on mouseUp
  87.   global aNumber,theListIsEmpty,theLength
  88.   put 1 into aNumber
  89.   put "true" into theListIsEmpty
  90.   put length(card field "thePassList") into theLength
  91.   repeat theLength
  92.     if theListIsEmpty="false" then exit repeat
  93.     put charToNum(character aNumber of card field "thePassList") into theCharacter
  94.     if theCharacter>32 and theCharacter‚â†127 and theCharacter‚â†202 then
  95.       put "false" into theListIsEmpty
  96.     end if
  97.     add 1 to aNumber
  98.   end repeat
  99.   if theListIsEmpty="false" then
  100.     ask file "Create a password file:" with "PasswordList"
  101.     if the result is "Cancel" or it is empty then exit mouseUp
  102.     put it into fileName
  103.     open file fileName
  104.     write card field "thePassList" to file fileName
  105.     close file fileName
  106.   else
  107.     answer "There is nothing to export." with "Sorry"
  108.   end if
  109. end mouseUp
  110.  
  111.  
  112. -- part 4 (button)
  113. -- low flags: 00
  114. -- high flags: A002
  115. -- rect: left=0 top=98 right=149 bottom=124
  116. -- title width / last selected line: 0
  117. -- icon id / first selected line: 130 / 130
  118. -- text alignment: 1
  119. -- font id: 0
  120. -- text size: 12
  121. -- style flags: 0
  122. -- line height: 16
  123. -- part name: About…
  124. ----- HyperTalk script -----
  125. on mouseUp
  126.   put "Random Password Generator (HC)" & return after answerString
  127.   put "¬© 1995 Paul Schreiber <paul@magic.ca>" & return after answerString
  128.   put "version 1.1, August 19th, 1995" & return after answerString
  129.   put "This is completely free!" & return after answerString
  130.   put "No warranty!" & return after answerString
  131.   put "Commercial Distribution requires permission!" after answerString
  132.   answer answerString with "Okay"
  133. end mouseUp
  134.  
  135.  
  136. -- part 6 (field)
  137. -- low flags: 05
  138. -- high flags: 0002
  139. -- rect: left=0 top=148 right=164 bottom=124
  140. -- title width / last selected line: 0
  141. -- icon id / first selected line: 0 / 0
  142. -- text alignment: 0
  143. -- font id: 3
  144. -- text size: 9
  145. -- style flags: 0
  146. -- line height: 12
  147. -- part name: Status
  148.  
  149.  
  150. -- part contents for card part 6
  151. ----- text -----
  152. Processing: Done